package com.lei.datastructure;

import com.lei.linearsearch.Student;

/**
 * @Author LeiXiaoLei
 * @Date 2022/7/15 15:01
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        Array<Integer> array = new Array<>();
        for (int i = 0; i < 10; i++) {
            array.addLast(i);
        }
        System.out.println(array);
        array.add(1,100);
        System.out.println(array);
        array.add(0,-1);
        System.out.println(array);
        for (int i = 10; i < 20; i++) {
            array.addLast(i);
        }
        array.get(1);
        array.remove(1);
        for (int i = 0; i < 10; i++) {
            array.removeLast();
        }
        System.out.println(array);
        int i = array.find(1);
        array.removeFirst();
        array.removeLast();
        System.out.println(array);
        Array<Student> studentArray = new Array<>();
        studentArray.addLast(new Student("张三", 99));
        studentArray.addLast(new Student("李四", 45));
        studentArray.addLast(new Student("王五", 21));
        studentArray.addLast(new Student("赵六", 78));
        studentArray.addLast(new Student("王老七", 99));
        System.out.println(studentArray);
        studentArray.removeFirst();
        System.out.println(studentArray);
    }
}
